package com.wyy.mall.tiny01.common.api;

/**
 * 枚举常用API操作码，这里的操作码不是连接服务端的状态码，
 * created by 伍猷煜 on 2021/5/9 21:44 星期日
 */
public enum ResultCode implements IErrorCode {
    SUCCESS(200, "操作成功"),
    FAILED(500, "操作失败"),
    VALIDATE_FAILED(404, "参数校验失败"),
    UNAUTHORIZED(401, "暂未登录或token已经过期"),
    FORBIDDEN(403, "没有相关权限")
    ;
    private long code;
    private String message;
    ResultCode(long code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public long getCode() {
        return this.code;
    }

    @Override
    public String getMessage() {
        return this.message;
    }
}
